Rollup of 12 pull requests#156613
Closed
JonathanBrouwer wants to merge 28 commits into
Closed
Conversation
This ensures that user arguments can override target arguments without being silently ignored.
The linker will complain about undefined symbols otherwise and on object file formats with two level namespaces (Mach-O and PE/COFF) it is required to know which dylib a symbol will be imported from when linking a dylib or executable.
debuginfo: slices are DW_TAG_array_type's Rust debuginfo for unsized structs with embedded slice types is lacking, and it makes it difficult for debuggers to correctly print types like `Rc<str>` (eg rust-lang#114195). Specifically, these three structs would have essentially the same debug info (modulo some names): ```rust struct Foo { a: u32, s: str } // unsized struct Bar { a: u32, s: [u8] } // unsized struct Baz { a: u32, s: u8 } ``` This changes how the compiler generates debuginfo in this case, and I used existing compilers (gcc, clang) handling of C flexible member arrays as a reference.
…onszelmann Require EIIs to be defined when we compile a rust dylib The linker will complain about undefined symbols otherwise and on object file formats with two level namespaces (Mach-O and PE/COFF) it is required to know which dylib a symbol will be imported from when linking a dylib or executable. r? @jdonszelmann
…ream, r=petrochenkov Implement pinned drop sugar Implements `fn drop(&pin mut self)` as sugar for `Drop::pin_drop`. The resolver recognizes `fn drop(&pin mut self)` syntactically in trait impls and performs lookup using the effective `pin_drop` name. AST lowering independently rechecks the syntactic sugar, validates that the resolved item belongs to the actual `Drop` lang trait, and emits HIR with ident `pin_drop` for accepted sugar. Existing type checking, Drop validation, drop glue, and direct-call checks remain unchanged. Drop identity is checked during AST lowering through `tcx.lang_items().drop_trait()`, after resolver has performed the effective `pin_drop` lookup. The resolver does not need to know whether the trait is the actual `Drop` lang item, and it no longer passes marked impl item IDs to lowering. This intentionally preserves the base pinned-drop behavior where `#[pin_v2]` types must use `pin_drop`, while non-`#[pin_v2]` types may still implement `pin_drop`. r? @petrochenkov ## Related rust-lang#144537 rust-lang#130494
…lexcrichton Allow user-provided `llvm_args` to override target spec arguments This switches the order in which `-Cllvm-args` is applied between target-spec arguments and user-provided LLVM arguments. This came up in rust-lang#156061, where the target passing `-Cllvm-args=-wasm-use-legacy-eh=false` means that a user passing `-Cllvm-args=-wasm-use-legacy-eh=true` cannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first. With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out. Originally this PR added support for a dedicated `-Z` flag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours. //cc @alexcrichton
Disable `main_needs_argc_argv` for Wasm AFAIU this explains to the "Rust Runtime" that `main()` doesn't need `argc`/`argv`. Newer Wasm targets have explicitly disabled this, this PR changes it so that the base Wasm configuration affecting all Wasm targets disables this now. This affects the following targets: - `wasm32-unknown-unknown` - `wasm32v1-none` - `wasm64-unknown-unknown` The only Wasm target where `main_needs_argc_argv` is still enabled is `wasm32-unknown-emscripten`. @hoodmane let me know and I can remove it there as well. Credit goes to @Spxg for stumbling on this. r? @alexcrichton
…BoxyUwU Make const param default test reproduce original ICE As discussed in [comment](rust-lang#156325 (comment)). ICE using old logic: [old-logic-ice.txt](https://github.com/user-attachments/files/27797628/old-logic-ice.txt) r? BoxyUwU
actually run the temp_dir doctest No idea why this currently doesn't get run. That said, this might fail in Miri, so we may have to wait for rust-lang/miri#5029.
…utf8-pattern, r=ChrisDenton Require UTF-8 in `Utf8Pattern::StringPattern` Store `&str` instead, so the UTF-8 invariant is enforced at the API boundary. Fixes rust-lang#156491
…, r=petrochenkov delegation: emit error when self type is not specified and accessed This PR adds error reporting when we create error self type if it was not specified. In most of the tests there were other errors, so this delayed bug was not triggered, but there are cases like `reuse Default::default;` (rust-lang#156388) which does not emit other errors and those delayed bugs are triggered. Part of rust-lang#118212. Fixes rust-lang#156388. r? @petrochenkov
…i-obk Use DropCtxt::new_block and new_block_with_statements systematically. Misc cleanups I found while staring at that code.
…xpansion, r=Urgau Correctly handle associated items in rustdoc macro expansion Fixes rust-lang#156075. The bug was simply that it didn't cover associated items. r? @Urgau
coverage: Reduce and clarify the context-mismatch test case Most of the complexity in this test case isn't needed to reproduce the condition observed in rust-lang#147339. I have checked that this reduced test case still triggers the context-mismatch in `extract_refined_covspans`.
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 15, 2026
Rollup of 12 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 15, 2026
…uwer Rollup of 12 pull requests Successful merges: - #153238 (debuginfo: slices are DW_TAG_array_type's) - #156319 (Require EIIs to be defined when we compile a rust dylib) - #156452 (Implement pinned drop sugar) - #156554 (Allow user-provided `llvm_args` to override target spec arguments) - #156571 (Disable `main_needs_argc_argv` for Wasm) - #156600 (Make const param default test reproduce original ICE) - #156493 (actually run the temp_dir doctest) - #156556 (Require UTF-8 in `Utf8Pattern::StringPattern`) - #156565 (delegation: emit error when self type is not specified and accessed) - #156586 (Use DropCtxt::new_block and new_block_with_statements systematically.) - #156587 (Correctly handle associated items in rustdoc macro expansion) - #156604 (coverage: Reduce and clarify the context-mismatch test case)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for af919b9 failed: CI. Failed job:
|
Contributor
|
PR #153238, which is a member of this rollup, was unapproved. |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for ea9529a failed: CI. Failed jobs:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
llvm_argsto override target spec arguments #156554 (Allow user-providedllvm_argsto override target spec arguments)main_needs_argc_argvfor Wasm #156571 (Disablemain_needs_argc_argvfor Wasm)Utf8Pattern::StringPattern#156556 (Require UTF-8 inUtf8Pattern::StringPattern)r? @ghost
Create a similar rollup